/**
 * Created by mengkeys on 2016-12-24.
 */

module.exports = function () {
    return function (req, res, next) {
        if(req.session && req.session.logined){
            return next(null);
        } else {
            return res.redirect('/login?from='+req.originalUrl)
        }
    }
};
